; ; GETCMD -- process input to conversation box ; (c) 1990 Chris Butler ; uses buffer 5 for temp getcmd: noise 100 100 10 local bndryoff (@boxllx+417)%8 ; boundary offset local flashon "1" ; flash toggle cgetbuf 5 @boxllx+417,@boxlly+97 @boxllx+481,@boxlly+108 0 0 ; CONT keytop cmdloop: color @keycolor if @flashon rect @boxllx+417,@boxlly+97 @boxllx+481,@boxlly+108 0 0 ; blank CONT key local flashon "0" else putup @bndryoff,0 5 local flashon "1" endif ; waitkey 15 nokeyyet waitkey 40 cmdloop ifkey b cmdb c cmdc h cmdh m cmdm s cmds left cmdb right cmdc "?" cmdh ifkey "B" cmdb "C" cmdc "H" cmdh "M" cmdm "S" cmds ESC cmdm RETURN cmdc noise 100,1000 10 goto cmdloop nokeyyet: ifmouse 1,gotbttn,,,,,,15,cmdloop ; disabled 11/3/90 gotbttn: getmouse but x,y if (@x<@boxllx)||(@x>@boxllx+@boxw)||(@y<@boxlly+94)||(@y>@boxlly+111) badlocn ; test if x,y is in menu bar if @x<(@boxllx+66) cmdb if @x<(@boxllx+119) cmdm if @x<(@boxllx+166) cmdh if @x<(@boxllx+350) badlocn if @x<(@boxllx+414) cmds if @x<(@boxllx+484) cmdc badlocn: noise 1000,100 10 goto cmdloop cmdb: set bttnx @boxllx+"4" ; backup button set w "62" putup @bndryoff,0 5 ; make sure keytop lettering in place pushbutton @bttnx,@boxlly+94,@h,@w,@keycolor ; "95"=y offset height for button return "backup" cmdc: set bttnx @boxllx+414 ; continue button set w "70" putup @bndryoff,0 5 ; make sure keytop lettering in place pushbutton @bttnx,@boxlly+94,@h,@w,@keycolor ; return "continue" cmdh: set bttnx @boxllx+"119" ; help button set w "47" putup @bndryoff,0 5 ; make sure keytop lettering in place pushbutton @bttnx,@boxlly+94,@h,@w,@keycolor ; gosub convhelp goto cmdloop cmdm: set bttnx @boxllx+"66" ; menu button set w "53" ; putup @bndryoff,0 5 ; make sure keytop lettering in place pushbutton @bttnx,@boxlly+94,@h,@w,@keycolor ; gosub menu_cmd goto cmdloop cmds: set bttnx @boxllx+"350" ; screen button set w "64" putup @bndryoff,0 5 ; make sure keytop lettering in place pushbutton @bttnx,@boxlly+94,@h,@w,@keycolor ; screen color @keycolor goto cmdloop done: return ; subr GETCMD ; ; SCREEN -- temporarily remove CONVBOX from screen ; screen: cfree 3 ; dump blank convbox cgetbuf 3 @boxllx,@boxlly @boxllx+@boxw,@boxlly+117 1 0 ; save current convbox putup 0,0 2 ; restore original convbox color 0,15 box @boxllx,@boxlly @boxllx+@boxw,@boxlly+115 2 ; outline box to replace convbox fload russell fstyle 6 2 2 text @boxllx+100,@boxlly+50 "type R to Restore" cgetbuf 4 @boxllx,@boxlly @boxllx+@boxw,@boxlly+119 1 0 ;save orig w/restore msg waitkey 50 littloop: putup 0,0 2 ifmouse 1 littlp4,,,,,, 20 littlp1 littlp1: waitkey 20 littlp2 ifkey r littlp4 "R" littlp4 ; want r/R to "restore" noise 100,1000 30 goto littlp2 littlp2: putup 0,0 4 ifmouse 1 littlp4,,,,,, 20 littlp3 littlp3: waitkey 20 littloop ifkey r littlp4 "R" littlp4 ; want r/R to "restore" noise 100,1000 30 goto littloop littlp4: putup 0,0 3 ; replace original fload ibm16 ; restore orig font fstyle 0 ; turn off shadowing return ; subr SCREEN ; ; CONVHELP -- putup help for CONVBOX ; uses buffer 3 ; called from GETCMD convhelp: local sidemarg 3 local bottmarg 2 local rim 5 local picdim 80 local fotollx @boxllx+@rim+@sidemarg local fotolly @boxlly+@rim+@bottmarg+1 local fotourx @boxllx+@boxw-(@sidemarg+@rim+1) local fotoury @boxlly+@rim+@bottmarg+@picdim+2 local flashon 0 cgetbuf 3 @fotollx,@fotolly @fotourx,@fotoury 1 0; local txtoff (@fotollx)%8 ; boundary offset of clipping local contoff (@boxllx+417)%8 ; boundary offset of clipping color @txtboxclr rect @fotollx+1,@fotolly+1 @fotourx,@fotoury ; blank out fotos+txt cload cwhelp 1 1 0 ; help panel putup @fotollx+16,@fotolly+1 1 color @keycolor helploop: if @flashon rect @boxllx+417,@boxlly+97 @boxllx+481,@boxlly+108 0 0 ; blank CONT key local flashon "0" else putup @contoff,0 5 local flashon "1" endif ifmouse 1 helpdone,,,,,, 20 helplp1 helplp1: waitkey 20 helploop helpdone: putup @txtoff,0 3 ; restore original convbox return ; subr CONVHELP ; MENU_CMD -- LINK BACK TO MAIN MENU IN MASTER ; ; uses cbuf 3 (temp) ; menu_cmd: local sidemarg 3 local bottmarg 2 local rim 5 local picdim 80 local fotollx @boxllx+@rim+@sidemarg local fotolly @boxlly+@rim+@bottmarg+1 local fotourx @boxllx+@boxw-(@sidemarg+@rim+1) local fotoury @boxlly+@rim+@bottmarg+@picdim+2 local flashon 0 cgetbuf 3 @fotollx,@fotolly @fotourx,@fotoury 1 0; local txtoff (@fotollx)%8 ; boundary offset of clipping local contoff (@boxllx+417)%8 ; boundary offset of clipping color @txtboxclr rect @fotollx+1,@fotolly+1 @fotourx,@fotoury ; blank out fotos+txt cload menuwarn 1 1 0 ; help panel putup @fotollx+16,@fotolly+1 1 color @keycolor waitkey ifkey "M" menu_out m menu_out putup @txtoff,0 3 ; restore original convbox return menu_out: link master.txt @entrypoint ; END SUBR MENU_CMD ; ; ; PUSHBUTTON -- actuate onscreen "button" ; uses MS Windows button format (white #15 top line and ; 2 bars of gray #8 shading) ; pushbutton: local llx @1 ; lower left corner of button x local lly @2 ; lower left corner y local h @3 ; height local w @4 ; width local keycolor @5 ; color of keytop ; note: uses buffer 1 local bndryoff (@llx+2)%8 ; boundary offset (@llx+2=x start of clipping) set wait "0" ; diagnostic switch cgetbuf 1 @llx+2,@lly+3 @llx+@w-3,@lly+@h-2 0 0; grab center of button color @keycolor if @wait waitkey endif line @llx+1,@lly+1 @llx+1,@lly+@h-1 ; gray out left white line line @llx+1,@lly+@h-1 @llx+@w-1,@lly+@h-1 ; gray out top white line putup 1+@bndryoff,-1 1 color @keycolor point @llx+2,@lly+2 point @llx+@w-2,@lly+@h-2 if @wait waitkey endif putup 2+@bndryoff,-2 1 point @llx+2,@lly+1 point @llx+3,@lly+1 point @llx+@w-1,@lly+@h-2 point @llx+@w-1,@lly+@h-3 color 8 line @llx+1,@lly+@h-1 @llx+@w-1,@lly+@h-1 color 0 line @llx+1,@lly+1 @llx+1,@lly+@h-1 if @wait waitkey endif putup 1+@bndryoff,-1 1 color 7 line @llx+2,@lly+1 @llx+@w-1,@lly+1 line @llx+@w-1,@lly+1 @llx+@w-1,@lly+@h-2 color @keycolor line @llx+1,@lly+@h-1 @llx+@w-1,@lly+@h-1 line @llx+1,@lly+1 @llx+1,@lly+@h-1 if @wait waitkey endif cgetbuf 1 @llx+3,@lly+1 @llx+@w-1,@lly+@h-3 0 0 ; putup @bndryoff,1 1 ; new clipping from lr corner color 15 line @llx+1,@lly+1 @llx+1,@lly+@h-1 line @llx+1,@lly+@h-1 @llx+@w-1,@lly+@h-1 color 7 point @llx+1,@lly+1 ; ll corner point @llx+@w-1,@lly+@h-1 ; tr corner if @wait waitkey endif return ; subr PUSHBUTTON ; ; MAXTALK -- set palette to (de-)highlight Max's photo box ; -- called w/@1 = 1 then highlight Max ; maxtalk: if @1 putup @boxllx+8,@boxlly+9 30 putup @boxllx+400,@boxlly+9 32 else putup @boxllx+8,@boxlly+9 32 putup @boxllx+400,@boxlly+9 31 endif return ; MAXTALK subr ; ; SAY -- put speech into the conversation box ; @1 speaker (1=max,0=other) ; @2 first text string ; @3 second text string ; say: fload ibm16 color @txtboxclr rect @boxllx+94,@boxlly+9 @boxllx+394,@boxlly+89 waitkey 50 color 0 maxtalk @1 window @boxllx+100,@boxlly+13 @boxllx+390,@boxlly+87 text @2 3 text @3 3 window return ; subr SAY ; ; NEWBGRND -- installs new bgrnd and convbox ; @1 = new pic name ; @2 = new conv box llx (must be byte boundary) ; @3 = new conv box lly ; @4 = 1 => maxtalk (hilite max's box) ; @5 = 1 => install new palette ; @6 = delay between pic and convbox ; @7 = pic fade to use ; ** puts orig under convbox in buffer 2 newbgrnd: set boxllx @2 set boxlly @3 pload @1 1 if @5 palette 1 endif pfade @7 1 pfree 1 cgetbuf 2 @boxllx,@boxlly @boxllx+@boxw,@boxlly+@boxh 1 0 ; save orig to buff 2 cload smbox2.clp 3 1 0 ; blank convbox to buffer 3 waitkey @6 ; delay before conv box putup @boxllx,@boxlly 3 ; putup conv box cfree 3 putup @boxllx+8,@boxlly+9 30 ; max foto putup @boxllx+400,@boxlly+9 31 ; other foto if @4 maxtalk 1 else maxtalk 0 endif fload normal.fnt ; label for convbox color 0 text @boxllx+177,@boxlly+99 @boxtitle fload ibm16 return ; subr NEWBGRND